package com.gumball.states;

import com.gumball.context.GumballMachine;

public class NoQuarterState implements State {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6485322966736896765L;
	private transient GumballMachine gumballMachine;

	public NoQuarterState(GumballMachine gumballMachine) {
		this.gumballMachine = gumballMachine;
	}

	@Override
	public void insertQuater() {
		System.out.println("You inserted a quarter");
		gumballMachine.setState(gumballMachine.getHasQuarterState());
	}

	@Override
	public void ejectQuater() {
		System.out.println("You haven't inserted a quarter");
	}

	@Override
	public void turnCrank() {
		System.out.println("You turned, but there's no quater");
	}

	@Override
	public void dispense() {
		System.out.println("You need to pay first");

	}
	
	public String toString() {
		return "waiting for quater";
	}

}
